var express = require('express');
var app = express();

app.use(express.static('1'));
// app.use(express.static('state'));


app.use((req, res, next) => {
    res.header('Access-Control-Allow-Origin', 'http://localhost:10086');
    res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
    res.header('Access-Control-Allow-Headers', 'Content-Type');
    res.header('Access-Control-Allow-Credentials','true');
    next();
})


app.use('/getList', (req, res) => {
    res.json({
        code: 200,
        data: [
            {
              id: 0,
              name: '磁共振',
              head: '',
              photo: [
                {
                  name: 'SZ-256E',
                  img: 'http://www.sowincnc.com/img.ashx?shopid=17557&file=2020102814342832.jpg'
                }
              ],
              '3d': [
                {
                  name: 'http://www.sowincnc.com/img.ashx?shopid=17557&file=2020102913490671.jpg',
                  img: 'SZ-205E1 SZ-205E2'
                }
              ]
            }
        ]
    })
})

console.log('服务器启动: 3000');
app.listen(3000);
